import request from './request'
// 牧场新增
export const styAdd = (addSty) => {
  return request({
    url: '/sty/add',
    method: 'post',
    data: addSty,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 牧场列表
export const styList = (params) => {
  return request({
    url: '/sty/list',
    method: 'get',
    param: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

//  牧场详情
export const styDetail = (styId) => {
  return request({
    url: '/sty/detail',
    method: 'get',
    param: {
      styId
    },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改牧场
export const styUpdate = (updateSty) => {
  return request({
    url: '/sty/update',
    method: 'post',
    data: updateSty,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 牧场下圈棚列表
export const penPenList = (ranchId) => {
  return request({
    url: '/pen/penList',
    method: 'get',
    param: {
      ranchId
    },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 获取全部牧场列表 （查询使用）
export const styStyList = (penId) => {
  return request({
    url: '/sty/styList',
    method: 'get',
    param: {
      penId
    },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
